from flask import Flask
import logging
logger = logging.getLogger(__name__)
from .decorator.ext_decorator import ext_decorator
@ext_decorator
def init_plugins(app: Flask) -> None:
    """
    初始化插件
    :param app:
    :return:
    """
    # 初始化插件管理器
    try:
        from apps.common.utils.plugin_manager import get_plugin_manager

        plugin_manager = get_plugin_manager(app)
        logger.info(f"✓ 插件管理器初始化成功，已安装插件: {list(plugin_manager.plugins.keys())}")
    except Exception as e:
        logger.error(f"⚠ 插件管理器初始化失败: {e}")